"""
判断密码长度,足够8位执行,不足抛出异常
"""


def input_password():
    pwd = input('请输入密码:')
    if len(pwd) >= 8:
        return pwd
    ex = Exception('密码长度不够')   # 核心代码
    raise ex


try:
    input_password()
except Exception as result:
    print(result)
